<?php

namespace app\third\logic\phoneCode\driver;

use AlibabaCloud\Client\Exception\ClientException;

abstract class Base
{
    /**
     * 发送验证码
     * @param string $type
     * @param string $phone
     * @param string $ip
     * @return mixed
     */
    abstract public function sendCode(string $type, string $phone, string $ip = '');

    /**
     * 发送短信
     * @param $type
     * @param $phone
     * @param $params
     * @return mixed
     */
    abstract public function send($type, $phone, $params);

    protected $init = [];

    /**
     * 初始化
     * @return array
     * @throws ClientException
     * @throws \Exception
     */
    abstract protected function initClient();
}